package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicDepModeMapper;
import com.code.base.dic.pojo.DicDepMode;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicDepModeService {


	@Resource
	private DicDepModeMapper dicDepModeMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicDepMode getDataById(Long id) {
		return dicDepModeMapper.getDataById(id);
	}

	public List<DicDepMode> getAllData() {
		return dicDepModeMapper.getAllData();
	}

	public int getDataCountByCondition(DicDepMode entity) {
		return dicDepModeMapper.getDataCountByCondition(entity);
	}

	public List<DicDepMode> getDataByCondition(DicDepMode entity) {
		return dicDepModeMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicDepMode entity) {
		return dicDepModeMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicDepMode> getDataByLikeCondition(DicDepMode entity) {
		return dicDepModeMapper.getDataByLikeCondition(entity);
	}

	public List<DicDepMode> getDataByIds(Long[] ids) {
		return dicDepModeMapper.getDataByIds(ids);
	}

	public void insertData(DicDepMode entity) {
		insertData(entity, true);
	}

	public void insertData(DicDepMode entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicDepModeMapper.insertData(entity);
	}

	public void updateData(DicDepMode entity) {
		dicDepModeMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicDepModeMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicDepMode entity) {
		dicDepModeMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicDepModeMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicDepModeMapper.deleteDataByIds(ids);
	}

}
